//
//  TicketCell.m
//  BigJoy
//
//  Created by Rowling on 2017/6/27.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "TicketCell.h"
@interface TicketCell()
@property (weak, nonatomic) IBOutlet UIImageView *backImageView;

@end
@implementation TicketCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.backImageView.layer.shadowOffset = CGSizeMake(0, 5);
    self.backImageView.layer.shadowColor = XMColor(200, 200, 200).CGColor;
    self.backImageView.layer.shadowOpacity = 0.3;
}

-(void)setFrame:(CGRect)frame {
    frame.origin.x += 10;
    frame.size.width -= 20;
    frame.origin.y += 10;
    frame.size.height -= 10;
    [super setFrame:frame];
}

-(void)setType:(UseType)type {
    _type = type;
    if (type == UseAble) {
        self.backImageView.image = [UIImage imageNamed:@"youhuiuquan"];
    }
    if (type == hadUse) {
        self.backImageView.image = [UIImage imageNamed:@"youhuiquan_yishiyong"];
    }
    if (type == OutDate) {
        self.backImageView.image = [UIImage imageNamed:@"youhuiquan_yiguoqi"];
    }
}

+(instancetype)cellWithTalbelView:(UITableView *)table {
    TicketCell * cell = [table dequeueReusableCellWithIdentifier:@"TicketCell"];
    if (cell == nil) {
        cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
    }
    return cell;
}


@end
